package com.lanou.musicproject.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lanou.musicproject.fragment.AlbumFragment;
import com.lanou.musicproject.fragment.SeekSingerAlbumFragment;
import com.lanou.musicproject.fragment.SeekSingerInfoFragment;
import com.lanou.musicproject.fragment.SeekSongFragment;
import com.lanou.musicproject.fragment.SingerFragment;


import java.util.ArrayList;

/**
 * Created by dllo on 15/10/23.
 */
public class SeekSingerAdapter extends FragmentPagerAdapter {
    private String[] titles = {"单曲", "专辑", "歌手信息"};
    private ArrayList<Fragment> datas;

    public SeekSingerAdapter(FragmentManager fm) {
        super(fm);
        init();
    }

    private void init() {
        datas = new ArrayList<Fragment>();
        datas.add(new SeekSongFragment());
        datas.add(new SeekSingerAlbumFragment());
        datas.add(new SeekSingerInfoFragment());

    }

    @Override
    public Fragment getItem(int position) {
        return datas.get(position);
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
